package com.woniuxy.staffservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.staffservice.entity.User;
import com.woniuxy.staffservice.mapper.UserMapper;
import com.woniuxy.staffservice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void add(User user) {
        userMapper.insert(user);
    }

    @Override
    public List<User> getByCondition(Integer deptid, String deptname, String name, String address, Integer index, Integer limit) {
        return userMapper.getByCondition(deptid, deptname, name, address, index, limit);
    }

    @Override
    public List<User> getByDeptId(Integer deptid) {
        return userMapper.getByDeptId(deptid);
    }

    @Override
    public void deleteById(int id) {
        userMapper.deleteById(id);
    }
}
